﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReadyApps.Data.Wiki
{
    /// <summary>
    /// Represents a single level in the permissions inheritance hierarchy.
    /// </summary>
    /// <seealso cref="PermissionsHierarchy"/>
    [Serializable]
    public class ObjectPermissionSet
    {
        #region Properties

        /// <summary>
        /// Gets the name of the level's object.
        /// </summary>
        public string Name { get; private set; }

        /// <summary>
        /// Gets the unique permission set identifier of the level's object.
        /// </summary>
        public int PermissionSetID { get; private set; }

        /// <summary>
        /// Gets a value indicating whether or not this is the level that is currently
        /// active in the hierarchy.
        /// </summary>
        public bool IsActive { get; internal set; }

        #endregion

        #region Constructor

        /// <summary>
        /// Creates a new <see cref="ObjectPermissionSet"/> object for a single level of
        /// a permissions inheritance hierarchy.
        /// </summary>
        /// <param name="name">The name of the object.</param>
        /// <param name="permissionSetID">The unique permission set identifier of the object.</param>
        public ObjectPermissionSet(string name, int permissionSetID)
        {
            Name = name;
            PermissionSetID = permissionSetID;
            IsActive = false;
        }

        #endregion
    }
}
